Skip to content

feat: support local package artifacts in requirements#3095

Open
anish-sahoo wants to merge 4 commits into
mainfrom
issue-1945
Open

feat: support local package artifacts in requirements#3095
anish-sahoo wants to merge 4 commits into
mainfrom
issue-1945

Conversation

@anish-sahoo

@anish-sahoo anish-sahoo commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • support simple local wheel/source archive paths in build.python_requirements
  • stage referenced artifacts through the existing cog_build context before pip install
  • document supported requirements syntax and add unit/integration coverage

Fixes #1945

Supported examples

Users can list local artifacts directly in their requirements file:

./dist/mylib-0.1.0-py3-none-any.whl
./vendor/helperlib.zip
./packages/localpkg.tar.gz

Paths are resolved relative to the requirements file and must point to regular files inside the project. Cog stages those files before the generated pip install -r /tmp/requirements.txt layer, without copying the full source tree earlier.

Not supported in this PR:

  • build.run: pip install ./artifact.zip
  • local package directories
  • name @ file:...
  • local --find-links directories
  • recursive local requirements includes
  • inline hashes/options on local artifact lines

@anish-sahoo
anish-sahoo requested a review from a team as a code owner July 7, 2026 21:10
@ask-bonk

ask-bonk Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@anish-sahoo anish-sahoo changed the title Support local package artifacts in requirements feat: support local package artifacts in requirements Jul 7, 2026

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

This PR adds support for staging local wheel/source-archive paths from requirements.txt through the cog_build context before pip install. Overall the approach is clean and well-tested. I found one issue where a valid pip syntax that references local paths can slip through and cause a confusing build failure.

Comment thread pkg/requirements/local_artifact.go
Comment thread pkg/requirements/requirements_test.go
@ask-bonk

ask-bonk Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds support for staging local wheel/source-archive paths from requirements.txt through the cog_build context before pip install. Overall the approach is clean and well-tested. I found one issue where a valid pip syntax that references local paths can slip through and cause a confusing build failure.

Posted a batch review with 2 suggestions on PR #3095:
#3095 (review)

github run

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@anish-sahoo Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

2 similar comments
@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@anish-sahoo Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@anish-sahoo Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installing local packages during cog build

1 participant